<?php
include("./mysql-connect.php");
$id = $_GET['id'];
// 获取id后到数据库查询
$res = mysqli_query($con,"select * from shop where id='$id'");
$row = mysqli_fetch_assoc($res);
// 如果查询到结果
if($row){
    $arr = [
    "meta"=>[
        "status"=>1,
        "msg"=>"查询成功"
    ],
    "data"=>$row
];
}else{
    $arr = [
        "meta"=>[
            "status"=>0,
            "msg"=>"该商品已经下架了"
        ]
    ];

}
echo json_encode($arr);


